
import { useMount } from 'ahooks';
import { useState, lazy, Suspense } from 'react'

import { ModelBox } from '../Model'
import { IndexedDBClear } from '../Utils/IndexedDB'
import { modelStore } from '../Config/zustand'


const LoadSvg = lazy(() => import('../View/Loading/LoadSvg'))

const index = () => {
    const [Template, setTemplate] = useState()
    useMount(async () => {
        IndexedDBClear()
        window.AUTH = '123'
        window.API = '223'
        window.IMG = '323'
        const temp = lazy(() => import(`./page/CommonManagement.jsx`))
        setTemplate(temp)
    })
    return (
        <Suspense>
            {Template ? <Template /> : <LoadSvg />}
            <ModelBox />
        </Suspense>
    );
};

export default index;